//client.cc

#include"Shm.hpp"
#include"namedPipe.hpp"

int main()
{
    //创建共享内存
    Shm shm(gpathname,gproj_id,gUser);
    shm.Zero();
    char *shmaddr=(char*)shm.Addr();
    sleep(3);

    //打开管道
    NamePiped fifo(comm_path,User);
    fifo.OpenForWrite();

    //当成string进行通信
    char ch='A';
    while(ch<='Z')
    {
        shmaddr[ch-'A']=ch;
        std::string temp="weakup";
        std::cout<<"add  "<<ch<<"into Shm, "<<"weakup reader"<<std::endl;
        fifo.WriteNamedPipe(temp);
        sleep(2);
        ch++;

    }

    return 0;
}